/*
 * Copyright (c) 2014.  @石头哥哥
 * THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: protoFile.proto

package proto;

/**
 * Protobuf type {@code proto.RoleVo}
 *
 * <pre>
 * 角色vo      change!!!
 * </pre>
 */
public final class RoleVo extends
    com.google.protobuf.GeneratedMessage implements
    // @@protoc_insertion_point(message_implements:proto.RoleVo)
    RoleVoOrBuilder {
  // Use RoleVo.newBuilder() to construct.
  private RoleVo(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
    super(builder);
    this.unknownFields = builder.getUnknownFields();
  }
  private RoleVo(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

  private static final RoleVo defaultInstance;
  public static RoleVo getDefaultInstance() {
    return defaultInstance;
  }

  public RoleVo getDefaultInstanceForType() {
    return defaultInstance;
  }

  private final com.google.protobuf.UnknownFieldSet unknownFields;
  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
      getUnknownFields() {
    return this.unknownFields;
  }
  private RoleVo(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    initFields();
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          default: {
            if (!parseUnknownField(input, unknownFields,
                                   extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
          case 8: {
            bitField0_ |= 0x00000001;
            roleID_ = input.readUInt32();
            break;
          }
          case 18: {
            com.google.protobuf.ByteString bs = input.readBytes();
            bitField0_ |= 0x00000002;
            roleName_ = bs;
            break;
          }
          case 24: {
            bitField0_ |= 0x00000004;
            roleSex_ = input.readUInt32();
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e.getMessage()).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return proto.ProtoFile.internal_static_proto_RoleVo_descriptor;
  }

  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return proto.ProtoFile.internal_static_proto_RoleVo_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            proto.RoleVo.class, proto.RoleVo.Builder.class);
  }

  public static com.google.protobuf.Parser<RoleVo> PARSER =
      new com.google.protobuf.AbstractParser<RoleVo>() {
    public RoleVo parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return new RoleVo(input, extensionRegistry);
    }
  };

  @java.lang.Override
  public com.google.protobuf.Parser<RoleVo> getParserForType() {
    return PARSER;
  }

  private int bitField0_;
  public static final int ROLEID_FIELD_NUMBER = 1;
  private int roleID_;
  /**
   * <code>required uint32 roleID = 1;</code>
   *
   * <pre>
   *角色ID
   * </pre>
   */
  public boolean hasRoleID() {
    return ((bitField0_ & 0x00000001) == 0x00000001);
  }
  /**
   * <code>required uint32 roleID = 1;</code>
   *
   * <pre>
   *角色ID
   * </pre>
   */
  public int getRoleID() {
    return roleID_;
  }

  public static final int ROLENAME_FIELD_NUMBER = 2;
  private java.lang.Object roleName_;
  /**
   * <code>optional string roleName = 2;</code>
   *
   * <pre>
   *角色名称
   * </pre>
   */
  public boolean hasRoleName() {
    return ((bitField0_ & 0x00000002) == 0x00000002);
  }
  /**
   * <code>optional string roleName = 2;</code>
   *
   * <pre>
   *角色名称
   * </pre>
   */
  public java.lang.String getRoleName() {
    java.lang.Object ref = roleName_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      if (bs.isValidUtf8()) {
        roleName_ = s;
      }
      return s;
    }
  }
  /**
   * <code>optional string roleName = 2;</code>
   *
   * <pre>
   *角色名称
   * </pre>
   */
  public com.google.protobuf.ByteString
      getRoleNameBytes() {
    java.lang.Object ref = roleName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      roleName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int ROLESEX_FIELD_NUMBER = 3;
  private int roleSex_;
  /**
   * <code>optional uint32 roleSex = 3;</code>
   *
   * <pre>
   *角色性别
   * </pre>
   */
  public boolean hasRoleSex() {
    return ((bitField0_ & 0x00000004) == 0x00000004);
  }
  /**
   * <code>optional uint32 roleSex = 3;</code>
   *
   * <pre>
   *角色性别
   * </pre>
   */
  public int getRoleSex() {
    return roleSex_;
  }

  private void initFields() {
    roleID_ = 0;
    roleName_ = "";
    roleSex_ = 0;
  }
  private byte memoizedIsInitialized = -1;
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    if (!hasRoleID()) {
      memoizedIsInitialized = 0;
      return false;
    }
    memoizedIsInitialized = 1;
    return true;
  }

  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    getSerializedSize();
    if (((bitField0_ & 0x00000001) == 0x00000001)) {
      output.writeUInt32(1, roleID_);
    }
    if (((bitField0_ & 0x00000002) == 0x00000002)) {
      output.writeBytes(2, getRoleNameBytes());
    }
    if (((bitField0_ & 0x00000004) == 0x00000004)) {
      output.writeUInt32(3, roleSex_);
    }
    getUnknownFields().writeTo(output);
  }

  private int memoizedSerializedSize = -1;
  public int getSerializedSize() {
    int size = memoizedSerializedSize;
    if (size != -1) return size;

    size = 0;
    if (((bitField0_ & 0x00000001) == 0x00000001)) {
      size += com.google.protobuf.CodedOutputStream
        .computeUInt32Size(1, roleID_);
    }
    if (((bitField0_ & 0x00000002) == 0x00000002)) {
      size += com.google.protobuf.CodedOutputStream
        .computeBytesSize(2, getRoleNameBytes());
    }
    if (((bitField0_ & 0x00000004) == 0x00000004)) {
      size += com.google.protobuf.CodedOutputStream
        .computeUInt32Size(3, roleSex_);
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSerializedSize = size;
    return size;
  }

  private static final long serialVersionUID = 0L;
  @java.lang.Override
  protected java.lang.Object writeReplace()
      throws java.io.ObjectStreamException {
    return super.writeReplace();
  }

  public static proto.RoleVo parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static proto.RoleVo parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static proto.RoleVo parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static proto.RoleVo parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static proto.RoleVo parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return PARSER.parseFrom(input);
  }
  public static proto.RoleVo parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return PARSER.parseFrom(input, extensionRegistry);
  }
  public static proto.RoleVo parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return PARSER.parseDelimitedFrom(input);
  }
  public static proto.RoleVo parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return PARSER.parseDelimitedFrom(input, extensionRegistry);
  }
  public static proto.RoleVo parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return PARSER.parseFrom(input);
  }
  public static proto.RoleVo parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return PARSER.parseFrom(input, extensionRegistry);
  }

  public static Builder newBuilder() { return Builder.create(); }
  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder(proto.RoleVo prototype) {
    return newBuilder().mergeFrom(prototype);
  }
  public Builder toBuilder() { return newBuilder(this); }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessage.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * Protobuf type {@code proto.RoleVo}
   *
   * <pre>
   * 角色vo      change!!!
   * </pre>
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessage.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:proto.RoleVo)
      proto.RoleVoOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return proto.ProtoFile.internal_static_proto_RoleVo_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return proto.ProtoFile.internal_static_proto_RoleVo_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              proto.RoleVo.class, proto.RoleVo.Builder.class);
    }

    // Construct using proto.RoleVo.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
      }
    }
    private static Builder create() {
      return new Builder();
    }

    public Builder clear() {
      super.clear();
      roleID_ = 0;
      bitField0_ = (bitField0_ & ~0x00000001);
      roleName_ = "";
      bitField0_ = (bitField0_ & ~0x00000002);
      roleSex_ = 0;
      bitField0_ = (bitField0_ & ~0x00000004);
      return this;
    }

    public Builder clone() {
      return create().mergeFrom(buildPartial());
    }

    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return proto.ProtoFile.internal_static_proto_RoleVo_descriptor;
    }

    public proto.RoleVo getDefaultInstanceForType() {
      return proto.RoleVo.getDefaultInstance();
    }

    public proto.RoleVo build() {
      proto.RoleVo result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    public proto.RoleVo buildPartial() {
      proto.RoleVo result = new proto.RoleVo(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
        to_bitField0_ |= 0x00000001;
      }
      result.roleID_ = roleID_;
      if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
        to_bitField0_ |= 0x00000002;
      }
      result.roleName_ = roleName_;
      if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
        to_bitField0_ |= 0x00000004;
      }
      result.roleSex_ = roleSex_;
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof proto.RoleVo) {
        return mergeFrom((proto.RoleVo)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(proto.RoleVo other) {
      if (other == proto.RoleVo.getDefaultInstance()) return this;
      if (other.hasRoleID()) {
        setRoleID(other.getRoleID());
      }
      if (other.hasRoleName()) {
        bitField0_ |= 0x00000002;
        roleName_ = other.roleName_;
        onChanged();
      }
      if (other.hasRoleSex()) {
        setRoleSex(other.getRoleSex());
      }
      this.mergeUnknownFields(other.getUnknownFields());
      return this;
    }

    public final boolean isInitialized() {
      if (!hasRoleID()) {
        
        return false;
      }
      return true;
    }

    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      proto.RoleVo parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (proto.RoleVo) e.getUnfinishedMessage();
        throw e;
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private int roleID_ ;
    /**
     * <code>required uint32 roleID = 1;</code>
     *
     * <pre>
     *角色ID
     * </pre>
     */
    public boolean hasRoleID() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>required uint32 roleID = 1;</code>
     *
     * <pre>
     *角色ID
     * </pre>
     */
    public int getRoleID() {
      return roleID_;
    }
    /**
     * <code>required uint32 roleID = 1;</code>
     *
     * <pre>
     *角色ID
     * </pre>
     */
    public Builder setRoleID(int value) {
      bitField0_ |= 0x00000001;
      roleID_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>required uint32 roleID = 1;</code>
     *
     * <pre>
     *角色ID
     * </pre>
     */
    public Builder clearRoleID() {
      bitField0_ = (bitField0_ & ~0x00000001);
      roleID_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object roleName_ = "";
    /**
     * <code>optional string roleName = 2;</code>
     *
     * <pre>
     *角色名称
     * </pre>
     */
    public boolean hasRoleName() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    /**
     * <code>optional string roleName = 2;</code>
     *
     * <pre>
     *角色名称
     * </pre>
     */
    public java.lang.String getRoleName() {
      java.lang.Object ref = roleName_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          roleName_ = s;
        }
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <code>optional string roleName = 2;</code>
     *
     * <pre>
     *角色名称
     * </pre>
     */
    public com.google.protobuf.ByteString
        getRoleNameBytes() {
      java.lang.Object ref = roleName_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        roleName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <code>optional string roleName = 2;</code>
     *
     * <pre>
     *角色名称
     * </pre>
     */
    public Builder setRoleName(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000002;
      roleName_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>optional string roleName = 2;</code>
     *
     * <pre>
     *角色名称
     * </pre>
     */
    public Builder clearRoleName() {
      bitField0_ = (bitField0_ & ~0x00000002);
      roleName_ = getDefaultInstance().getRoleName();
      onChanged();
      return this;
    }
    /**
     * <code>optional string roleName = 2;</code>
     *
     * <pre>
     *角色名称
     * </pre>
     */
    public Builder setRoleNameBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000002;
      roleName_ = value;
      onChanged();
      return this;
    }

    private int roleSex_ ;
    /**
     * <code>optional uint32 roleSex = 3;</code>
     *
     * <pre>
     *角色性别
     * </pre>
     */
    public boolean hasRoleSex() {
      return ((bitField0_ & 0x00000004) == 0x00000004);
    }
    /**
     * <code>optional uint32 roleSex = 3;</code>
     *
     * <pre>
     *角色性别
     * </pre>
     */
    public int getRoleSex() {
      return roleSex_;
    }
    /**
     * <code>optional uint32 roleSex = 3;</code>
     *
     * <pre>
     *角色性别
     * </pre>
     */
    public Builder setRoleSex(int value) {
      bitField0_ |= 0x00000004;
      roleSex_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>optional uint32 roleSex = 3;</code>
     *
     * <pre>
     *角色性别
     * </pre>
     */
    public Builder clearRoleSex() {
      bitField0_ = (bitField0_ & ~0x00000004);
      roleSex_ = 0;
      onChanged();
      return this;
    }

    // @@protoc_insertion_point(builder_scope:proto.RoleVo)
  }

  static {
    defaultInstance = new RoleVo(true);
    defaultInstance.initFields();
  }

  // @@protoc_insertion_point(class_scope:proto.RoleVo)
}

